package com.lizhen.createpattern.abstractfactorypattern;

import com.lizhen.createpattern.abstractfactorypattern.impl.ColorFactory;
import com.lizhen.createpattern.abstractfactorypattern.impl.ShapeFactory;

public class AbstractFactoryProducer {
    public AbstractFactoryProducer() {
    }

    public static AbstractFactory getFactory(String choice) {
        if (choice.equalsIgnoreCase("SHAPE")) {
            return new ShapeFactory();
        } else {
            return choice.equalsIgnoreCase("COLOR") ? new ColorFactory() : null;
        }
    }
}
